package com.zeyi.chat.dto;

import com.zeyi.chat.po.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author zeyi
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Message implements Serializable {
    private static final long serialVersionUID = 3182475853472730629L;

    private Boolean flag; //消息状态
    private String serverPath; //服务端处理地址
    private String handlePath; //客户端处理地址
    private User sender; //发送方
    private Chat receiver; //接收方
    private String data; //数据

    public Message(String serverPath, String handlePath, String data) {
        this.serverPath = serverPath;
        this.handlePath = handlePath;
        this.data = data;
    }

    public Message(Boolean flag, String handlePath, String data) {
        this.flag = flag;
        this.handlePath = handlePath;
        this.data = data;
    }

    public Message(String handlePath, User sender, String data) {
        this.handlePath = handlePath;
        this.sender = sender;
        this.data = data;
    }

    public Message(String handlePath, User sender, Chat receiver, String data) {
        this.handlePath = handlePath;
        this.sender = sender;
        this.receiver = receiver;
        this.data = data;
    }

    public Message(String handlePath, String data) {
        this.handlePath = handlePath;
        this.data = data;
    }
}
